from aip import AipFace

""" 你的 APPID AK SK """
APP_ID = '16263369'
API_KEY = 'RKA0epeIpLaZPTrSPndKIfV8'
SECRET_KEY = 'kaH4lCs2zExu1WYhkezv1XvUhuZ1cS5K'

client = AipFace(APP_ID, API_KEY, SECRET_KEY)

def face_register(image,userId,imageType='BASE64',groupId='kangbazi_01'):

    res = client.addUser(image, imageType, groupId, userId)
    print(res)
    if res['error_code']:
        return False
    return True

def face_login(image,imageType='BASE64',groupId='kangbazi_01'):

    res = client.search(image, imageType, groupId);
    print(res)
    if res['error_code']:
        return False
    return True